import { NgModule } from "@angular/core";
import { RouterModule,Routes } from "@angular/router";
import { HomeComponent } from "./home/home.component";
import { Code404Component } from "./code404/code404.component";

import { loginComponent } from './login/login.component';
import { indexComponent } from "./index/index.component";
import {FromComponent} from "./from/from.component";
import {UserComponent} from "./business/user/user.component";
import {AirFactorComponent} from "./business/airFactor/airFactor.component";
import {AirPollutantComponent} from "./business/airPollutant/airPollutant.component";
import {CollectComponent} from "./business/collectData/collect.component";
import {ElecFactorComponent} from "./business/elecFactor/elecFactor.component";
import {LocalInfoComponent} from "./business/localInfo/localInfo.component";
import {MenuDataComponent} from "./business/menuData/menuData.component";
import {OperatorComponent} from "./business/operator/operator.component";
import {RoleComponent} from "./business/role/role.component";
import {SwitchFactorComponent} from "./business/switchFactor/switchFactor.component";
import {WaterFactorComponent} from "./business/waterFactor/waterFactor.component";
import {WaterPollutantComponent} from "./business/waterPollutant/waterPollutant.component";
import {DepartmentComponent} from "./business/department/department.component";
import {ReverseLogComponent} from "./business/reverseLog/reverseLog.component";
import {ReceiveLogComponent} from "./business/receiveLog/receiveLog.component";
import {ExceptionLogComponent} from "./business/exceptionLog/exceptionLog.component";
import {ConnectLogComponent} from "./business/connectLog/connectLog.component";
import {OperateLogComponent} from "./business/operateLog/operateLog.component";
import {CollectDataComponent} from "./business/collectData/collectData/collectData.component";
import {WaterComponent} from "./dims/water/water.component";
import {FieldEndComponent} from "./dims/Field-end/Field-end.component";
import {SewageComponent} from "./dims/sewage/sewage.component";
import {SurfaceWaterComponent} from "./dims/surface-water/surface-water.component";
import {AirQualityComponent} from "./dims/air-quality/air-quality.component";
import {VocComponent} from "./dims/VOC/VOC.component";
import {WorkingConditionComponent} from "./dims/working-condition/working-condition.component";
import {GasComponent} from "./dims/gas/gas.component";
import {HistoryComponent} from "./dims/history/history.component";
import {UnitComponent} from "./pages/pollutmanage/unit.component";
import {EliminatorComponent} from "./pages/servicemanage/eliminator.component";
import {PointComponent} from "./pages/pollutmanage/point.component";
import {EquipmentComponent} from "./pages/servicemanage/equipment.component";
import {CompanyComponent} from "./pages/servicemanage/company.component";
import {EnvironComponent} from "./pages/governmanage/environ.component";
import {StandardComponent} from "./pages/protectmanage/standard.component";
import {CodeComponent} from "./pages/usermanage/code.component";

const routers:Routes = [
  {path:'login',component:loginComponent},
  {path:'',redirectTo:'/login',pathMatch:'full'},
  {path:'index',component:indexComponent,
    children:[
      {path:'home',component: HomeComponent},
      {path:'from',component: FromComponent},
      {path:'airFactor',component: AirFactorComponent},
      {path:'airPollutant',component: AirPollutantComponent},
      {path:'collect',component: CollectComponent},
      {path:'collectData',component: CollectDataComponent},
      {path:'elecFactor',component: ElecFactorComponent},
      {path:'localInfo',component: LocalInfoComponent},
      {path:'menuData',component: MenuDataComponent},
      {path:'operator',component: OperatorComponent},
      {path:'role',component: RoleComponent},
      {path:'switchFactor',component: SwitchFactorComponent},
      {path:'user',component: UserComponent},
      {path:'waterFactor',component: WaterFactorComponent},
      {path:'waterPollutant',component: WaterPollutantComponent},
      {path:'department',component: DepartmentComponent},
      {path:'reverseLog',component: ReverseLogComponent},
      {path:'receiveLog',component: ReceiveLogComponent},
      {path:'exceptionLog',component: ExceptionLogComponent},
      {path:'connectLog',component: ConnectLogComponent},
      {path:'operateLog',component: OperateLogComponent},

      {path:'water',component: WaterComponent},
      {path:'air-quality',component: AirQualityComponent},
      {path:'Field-end',component: FieldEndComponent},
      {path:'sewage',component: SewageComponent},
      {path:'surface-water',component: SurfaceWaterComponent},
      {path:'voc',component: VocComponent},
      {path:'working-condition',component: WorkingConditionComponent},
      {path:'gas',component: GasComponent},
      {path:'history',component: HistoryComponent},

      {path:'unit',component: UnitComponent},
      {path:'eliminator',component: EliminatorComponent},
      {path:'point',component: PointComponent},
      {path:'company',component: CompanyComponent},
      {path:'equipment',component: EquipmentComponent},
      {path:'environ',component: EnvironComponent},
      {path:'standard',component: StandardComponent},
      {path:'code',component: CodeComponent}

    ]
  },
  {path:'**',component: Code404Component}
];

@NgModule({
  imports: [RouterModule.forRoot(routers,{'useHash': true})],
  exports: [RouterModule]
})

export class AppRoutingModule {}
